<?php
//StudentAction.class.php  学生相关操作
if(!defined("Yourphp")) exit("Access Denied");
class StudentAction extends BaseAction
{
  
    //已学习的岗位和项目
    public function visited() {
        $list = M('readrecord')->query("select fi.* from yourphp_readrecord as r left join yourphp_f_item as fi on r.fid = fi.id where r.userid = '$this->_userid' ");
        foreach ($list as $key => $value) {
            $list[$key]['renwus'] = M('renwu')->where(array('xmid' => $value['id']))->count();
            $list[$key]['weikes'] = M('weike')->where(array('xmid' => $value['id']))->count();
            $list[$key]['scbs'] = M('scb')->where(array('xmid' => $value['id']))->count();
            $list[$key]['zyid'] = M('gangwei')->where(array('id'=>$value['gwid']))->getField('zyid') ;
        }


        $gangwei = M('readrecord')->query("select fi.id from yourphp_readrecord as r left join yourphp_f_item as fi on r.fid = fi.id where r.userid = '$this->_userid' group by fi.gwid ");

        $this->assign('list', $list);
        $this->assign('gwsl', count($gangwei));
        $this->assign('yxxxm', count($list));
        $this->display();
    }

}